-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: 체감온도 계산식 구현 및 api 구현 #155
Conversation
@@ -51,12 +51,4 @@ public void airKoreaTest(@RequestBody AirTestRequest request) throws URISyntaxEx | |||
public void accuweatherTest(@RequestBody AccuweatherTestRequest request) throws URISyntaxException, IOException { | |||
weatherService.convertLocation(request.latitude(), request.longitude()); | |||
} | |||
|
|||
@GetMapping("/converㅅ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이런 오타 주의해주세요 ㅡㅡ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LocalDateTime을 문자열로 변환하는 로직이 있는데, 이를 별도의 유틸리티 클래스로 분리하면 좋을 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class DateTimeUtil {
public static String convertLocalDateTimeToString(LocalDateTime time) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd_HHmm");
return time.format(formatter);
}
public static LocalDateTime convertLocalDateTimeToDailyWeatherTime(LocalDateTime time) {
List<Integer> scheduledHours = Arrays.asList(0, 3, 6, 9, 12, 15, 18, 21);
int currentHour = time.getHour();
int adjustedHour = scheduledHours.stream()
.filter(hour -> hour <= currentHour)
.reduce((first, second) -> second)
.orElse(scheduledHours.get(scheduledHours.size() - 1));
if (currentHour < scheduledHours.get(0)) {
time = time.minusDays(1);
}
return time.withHour(adjustedHour).withMinute(0).withSecond(0).withNano(0);
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아이디어 감사합니당 🥵
결국 돌고 돌아 api로.. 인정입니다. |
☝️Issue Number
🔎 Key Changes
💌 To Reviewers